package com.twu.biblioteca;

import java.util.LinkedList;
import java.util.List;

public class BookManager {

    private BookShelf bookShelf;

    private final List<String> reservations = new LinkedList<String>();

    public BookManager(BookShelf bookShelf) {
        this.bookShelf = bookShelf;
    }

    public boolean reserveBook(String book) {
        boolean result = bookShelf.getBooks().contains(book)
                && reservations.contains(book) == false;
        if (result == true) {
            reservations.add(book);
        }
        return result;
    }

}
